<template>
  <div class="register-page">
    <van-nav-bar
      style="background-color: skyblue"
      title="收藏列表"
      left-arrow
      @click-left="$router.back()"
    />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <ArticleItem
        v-for="item in list"
        :key="item.id"
        :item="item"
      ></ArticleItem>
    </van-list>
  </div>
</template>

<script>
import {getCollect} from '@/api/user'
import ArticleItem from '@/components/ArticleItem.vue'
export default {
  components:{
    ArticleItem 
  },
  name: "register-page",
  data() {
    return {
      list:[],
      loading:false,
      finished:false
    };
  },
  methods: {
    async onLoad(){
     const {body} = await getCollect()
     this.list.push(...body)
    }
  },
};
</script>

<style lang="less" scoped>
.egister-page {
  color: #069;
  margin-bottom: 50px;
  margin-top: 44px;
}
</style>
